﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LogHelper
{
    public class IniConfig
    {
        private static IniConfig _IniConfig = null;
        private static object LockObj = new object();

        public string xtlb { get; set; }

        public string jkxlh { get; set; }

        public string cjsqbh { get; set; }

        public string dwjgdm { get; set; }

        public string dwmc { get; set; }

        public string zdbs { get; set; }


        public static IniConfig CreateInstance()
        {
            if(_IniConfig == null)
            {
                lock(LockObj)
                {
                    if(_IniConfig == null)
                    {
                        _IniConfig = new IniConfig();
                        _IniConfig.xtlb = IniHelper.ReadIni("ServerConfig", "xtlb");
                        _IniConfig.jkxlh = IniHelper.ReadIni("ServerConfig", "jkxlh");
                        _IniConfig.cjsqbh = IniHelper.ReadIni("ServerConfig", "cjsqbh");
                        _IniConfig.dwjgdm = IniHelper.ReadIni("ServerConfig", "dwjgdm");
                        _IniConfig.dwmc = IniHelper.ReadIni("ServerConfig", "dwmc");
                        _IniConfig.zdbs = IniHelper.ReadIni("ServerConfig", "zdbs");
                    }
                }
            }
            return _IniConfig;
        }
    }
}
